/**
 * Created by Administrator on 2015/11/11 0011.
 */
class Net {

    private static _ins: Net;
    public static get ins(): Net {
        if (!Net._ins) {
            Net._ins = new Net();
        }
        return Net._ins;
    }


    public constructor() {
        if (Net._ins) {
            throw new Error("Net 使用单例");
        }
    }



    /**
     * net请求
     * 
     * @param ca ["控制器","操作"] 或 ["操作"] 控制器 farm
     * @param data 发送参数 例：{"p1":"postP1","p2":"postP2"}
     * @param callback
     * @param key 需要储存的信息
     */
    public send(ca: Array<string>, data: Object, callback: Function, key?) {
        var net_send = new NetSend();
        net_send.send(ca, data, callback, key);
    }

}
